package com.ty.day5;

import java.util.Arrays;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/10 17:05
 */
public class Six {
    public static void main(String[] args) {
        int i = 2, j;
        int[] a=new int[0];
        while (i <= 100) {
            j = 2;
            while (j <= Math.sqrt(i)) {
                if (i % j == 0) {
                    break;
                }
                j++;
            }
            if (j >= Math.sqrt(i)) {
                a= Arrays.copyOf(a, a.length + 1);
                a[a.length-1]=i;
            }
            i++;
        }
        System.out.println(Arrays.toString(a));
    }
}
